import request from '@/utils/request'

// 查询群列表
export function listGroup(data) {
  return request({
    url: '/group/badmintonGroup/listPage',
    method: 'post',
    data: data
  })
}

// 查询群详细
export function getGroup(data) {
  return request({
    url: '/group/badmintonGroup/findDetail',
    method: 'post',
    data: data
  })
}

// 新增群
export function addGroup(data) {
  return request({
    url: '/group/badmintonGroup/add',
    method: 'post',
    data: data
  })
}

// 修改群
export function updateGroup(data) {
  return request({
    url: '/group/badmintonGroup/update',
    method: 'post',
    data: data
  })
}

// 删除群
export function delGroup(data) {
  return request({
    url: '/group/badmintonGroup/deletes',
    method: 'post',
    data: data
  })
}

/**
 * 分页用户群列表
 * @param data
 * @returns {*}
 */
export function getListByUserId(data) {
  return request({
    url: '/group/badmintonGroup/getListByUserId',
    method: 'post',
    data:data
  });
};

/**
 * 不分页用户群列表
 * @param data
 * @returns {*}
 */
export function findGroupByUserId(data) {
  return request({
    url: '/group/badmintonGroup/findGroupByUserId',
    method: 'post',
    params: data
  });
};

export function callFindList(data) {
  return findGroupByUserId(data).then(res => {
    return res;
  });
}

